#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    vector<int> twoSum(vector<int> &numbers, int target)
    {
        int left = 0, right = numbers.size() - 1;
        vector<int> ret;
        while (left < right)
        {
            if (numbers[left] + numbers[right] > target)
            {
                right--;
            }
            else if (numbers[left] + numbers[right] < target)
            {
                left++;
            }
            else
            {
                break;
            }
        }
        ret.push_back(left);
        ret.push_back(right);
        return ret;
    }
};